<template>
  <div>

    <el-input v-model="name"></el-input>
    <el-button @click="login">登录</el-button>
  </div>
</template>

<script>
export default {
  name: "MyLogin",
  data(){
    return{
      name:"xiao"
    }
  },
  methods:{
    login(){
      this.axios.get("login?name="+this.name)
          .then(res=>{
            console.log(res)
            if(res.data.code==200){
              localStorage.setItem("uid",res.data.data.uid)
              localStorage.setItem("rid",res.data.data.rid)
              this.$router.push(res.data.data.url)
            }
          })
    }
  }
}
</script>

<style scoped>

</style>
